systemsBdf <- ida.data.frame('DB2INST1.SHOWCASE_SYSTEMS')
is.ida.data.frame(systemsBdf)
#Select only certain rows or columns
#The following creates a ida.data.frame that only selects rows with
#TYPEID='1' and the first three columns of a table
systemsBdf2 <- systemsBdf[systemsBdf$TYPEID=='1',1:3]
#Alternatively, column names can be specified
systemsBdf2 <- systemsBdf[systemsBdf$TYPEID=='1',c('SID','DESCRIPTION')]
#Define new columns based on existing ones
systemsBdf$TYPEID2 <- systemsBdf$SID+10
systemsBdf$TYPEID3 <- ifelse(systemsBdf$SID==1,systemsBdf$SID,10)
head(systemsBdf)Run the code above in your browser using DataLab